<?php

namespace App\HttpController;

use EasySwoole\FastCache\Cache;
use EasySwoole\Http\AbstractInterface\Controller;
use EasySwoole\EasySwoole\ServerManager;
class Index extends Controller
{

    function index()
    {
        //真实地址
        $ip = ServerManager::getInstance()->getSwooleServer()->connection_info($this->request()->getSwooleRequest()->fd);
        var_dump($ip);
        //header 地址，例如经过nginx proxy后
        $ip2 = $this->request()->getHeaders();
        var_dump($ip2);
    }

}